﻿using System;
using System.Collections.Generic;
using System.Text;

namespace designmodule.behavioralmodule.Observer
{
    class program
    {
        void main()
        {
            //就是主题的发布订阅，  主题必须被订阅，也就是主题必须知道谁订阅，然后发布出去通知所有订阅者
            var subject = new ConcreteSubject();
            subject.Attach(new ConcreteObserver("X",subject));
            subject.Attach(new ConcreteObserver("Y",subject));
            subject.subjectState = "ABC状态";
            subject.Notify();
        }
    }
}
